<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>原材料采购管理</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
 
  <link rel="stylesheet" href="../../res/css/wholesale/font.css">
  <link rel="stylesheet" href="../../res/css/wholesale/xadmin.css">
  <link rel="stylesheet" href="../../res/layui/css/layui.css">
  <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
  <script type="text/javascript" src="../../res/layui/layui.js" charset="utf-8"></script>
  <script type="text/javascript" src="../../res/js/wholesale/xadmin.js"></script>
</head>
<body>
<div class="demoTable" style="margin-top: 10px;">
 
    <div class="x-body">
      <div class="layui-row">
        <div class="layui-form layui-col-md12 x-so">
          <input type="text" name="pdName" id="pdName" placeholder="请输入材料名称" autocomplete="off" class="layui-input">
          <button class="layui-btn" data-type="reload" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
        </div>
      </div>
      
<table class="layui-table" lay-filter="demo" id="purchaseDetail" style="width: 70%;">
  
</table>
 <script type="text/javascript">

 /**
  * 从地址栏传值的代码
  * @param param
  * @returns
  */

 function getParameter(param){
 	var query = window.location.search;
 	var iLen = param.length;
 	var iStart = query.indexOf(param);
 	if (iStart == -1)
 		return "";
 	iStart += iLen + 1;
 	var iEnd = query.indexOf("&", iStart);
 	if (iEnd == -1)
 		return query.substring(iStart);
 	return query.substring(iStart, iEnd);
 }
 
layui.use('table',function(){
	  var table = layui.table;
	  var form = layui.form;
	  
	  table.render({
		    elem: '#purchaseDetail'
		    	,page: true
		    ,url:'../../listenPurchaseDetail/materialDetailFindAll.action?purchaseId='+getParameter("purchaseId")
		    ,cols: [[
		       {field:'pdId',title: '采购明细ID', align:'center'}
		      ,{field:'purchaseId',title: '采购ID', align:'center'}
		      ,{field:'vocationalWorkId',title: '业务ID', align:'center',sort:true}
		      ,{field:'pdName',title: '采购名称', align:'center'}
		      ,{field:'pdNumber',title: '采购数量', align:'center'}
		      ,{field:'pdPrice',title: '单价', align:'center'}
		      ,{field:'pdSubtotal',title: '小计', align:'center',width: '40%'}
		    ]],done: function (res, curr, count) {
	            $("[data-field='pdId']").css('display','none');
	            $("[data-field='purchaseId']").css('display','none');
	            $("[data-field='vocationalWorkId']").css('display','none');
		    }
		  });
});

</script>

 </div>
 </div>
 
 


 
 
 

<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
 <script type="text/javascript" src="../../res/js/PurchaseRawstock/purchaseDetail.js"></script>
</body>
</html>